#pragma once
#include <iostream>

#include "LogicSystem.h"

class MsgNode {
 public:
  MsgNode(uint16_t len);
  ~MsgNode();

  void Clear();

  uint16_t _cur_len;
  uint16_t _total_len;
  char* _data;
};

class RecvNode : public MsgNode {
  friend class LogicSystem;

 public:
  RecvNode(uint16_t len, uint16_t msg_id);
  ~RecvNode();

 private:
  uint16_t _msg_id;
};

class SendNode : public MsgNode {
  friend class LogicSystem;

 public:
  SendNode(const char* data, uint16_t len, uint16_t msg_id);
  ~SendNode();

 private:
  uint16_t _msg_id;
};
